// import { request } from './request';
import request from '@/common/http/axios';

// /que-paper/findAll查询试卷
export function findAll(data) {
  return request({
    url: '/que-paper/findAll',
    method: 'post',
    data,
  });
}
///que-paper/add
export function addpaper(data) {
  return request({
    url: '/que-paper/add',
    method: 'post',
    data,
  });
}
// /que-question/delete

export function deldpaper(id) {
  return request({
    url: `/que-paper/delete?id=${id}`,
    method: 'post',
  });
}

// /que-question/maxOrder
export function maxOrder(paperId) {
  return request({
    url: '/que-question/maxOrder?id=' + paperId,
    method: 'get',
  });
}

// generate-pdf
export function generateWord(paperId, type) {
  return request({
    url: '/generate-word',
    method: 'get',
    responseType: 'blob',
    params: {
      paperId: paperId,
      type: type,
    },
    // headers: {
    //   'Content-Type': 'text/html',
    //   responseType: 'blob'
    // },
  });
}
// /fb/fetchPaper
export function fetchPaper(data) {
  return request({
    url: '/fb/fetchPaper',
    method: 'post',
    data,
  });
}
